f = open("cipher1.txt","r")
text = []
line = f.readlines()[0]
text = [int(x) for x in line.strip().split(',')]
f.close()


def toset(text):
    t = []
    for char in text:
        t.append(ord(char))
    return t

def decrypt(text,key):
    index = 0
    ret = ""
    for char in text:
        ret = ret + chr(char ^ key[index])
        index = (index + 1) % 3
    return ret
    
print(sum(toset(decrypt(text,toset("god")))))
    
'''
for a in range(97,122+1):
    for b in range(97,122+1):
        for c in range(97,122+1):
            if "the" in decrypt(text,[a,b,c]):
                print(chr(a)+chr(b)+chr(c)+"----")
                print(decrypt(text,[a,b,c]))
                '''